<?php
/*
 * SiteController.php
 * Classe controller des Sites
 */

namespace RHX\Controller;

use RHX\Model\Object\Site;
use RHX\Helper\Uploader;
use Zend\View\Model\JsonModel;

/**
 * Classe Site
 */
class SiteHoraireController extends RHXController {

    public function saveStringDataAction(){        
        $ret= array();
        
        // Changement de layout
        $this->layout('layout/ajax');

        // Récupération des données en Post
        $post = $this->getRequest()
                ->getPost();
        
        //table
        $siteHorTbl= $this->getService('Table\SiteHoraireTable');
        
        // Variables
        $pk = $post->get('pk');
        $name = $post->get('name');
        $value = $post->get('value');
        
        $sql = "UPDATE rh_site_horaire SET $name = '$value' WHERE id = $pk";
        $result = $siteHorTbl->executeQuery($sql);
        
        var_dump($sql);  die;
        
        return new JsonModel($ret);
    }
    
}

?>
